﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CorporateGym.DAL;

namespace BLL
{
    public class GymWorker
    {
        public int WorkerId{ get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string Phone { get; set; }
        public bool IsAdminitrator { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public string Email { get; set; }
        public string FullName { 
            get
            {
                return string.Format("{0} {1}", FirstName, LastName);
            }
            
            private set{}
        }

        public DateTime StartShift { get; set; }
        public DateTime EndShift { get; set; }

        public static GymWorker CreateFromRow(CorporateGymDB.GymWorkerRow i_Row)
        {
            return new GymWorker
            {
                FirstName = i_Row.FirstName,
                LastName = i_Row.LastName,
                IsAdminitrator = i_Row.isAdministrator,
                Phone = i_Row.Phone,
                Password = i_Row.Password,
                UserName = i_Row.UserName,
                WorkerId = i_Row.WorkerId,
                Email = i_Row.Email
            };
        }
    }
}
